// const {query} = require.main.require('app');
const {query} =  require('mysqlconnect');
// const controller = require.main.require('controllers/controllerDemo'); //这种引用方式是基于require.main.require(',,,')
// const controller = require('controllers/controllerDemo'); //这种引用方式是依赖于 app-module-path中间件
module.exports = {
  'GET /home/:title/:name': async (ctx, next)=>{
    await query("select * from info");
    ctx.body = {
      home: "GET home",
      title: ctx.params.title,
      name: ctx.params.name,
    };
  },
  'GET /home': async (ctx, next)=>{
    ctx.body = {
      home: 'POST home',
    };
  },
};
